package com.zhangh.summer.admin.support.log;

import org.slf4j.Logger;
import org.slf4j.MDC;

/**
 * @description: TODO
 * @author: zhanghui  zhanghlucky@163.com
 * @create: 2021-06-10 00:05
 **/
public  class LogRecorder {
    private static LogRecorder INSTANCE;
    static {
        INSTANCE = new LogRecorder();
    }
    private LogRecorder(){
    }

    public static LogRecorder instance() {
        return INSTANCE;
    }


    public  LogRecorder setKey1(Object businessKeyword1){
        MDC.put("bizKey1",String.valueOf(businessKeyword1));
        return this;
    }

    public   LogRecorder setKey2(Object businessKeyword2){
        MDC.put("bizKey2",String.valueOf(businessKeyword2));
        return this;
    }

    public   LogRecorder setUserID(Object userID){
        MDC.put("userID",String.valueOf(userID));
        return this;
    }
    /**
     * 设置 logger
     * @param logger Logger
     * @return Logger
     */
    public Logger logger(Logger logger){
        return logger;
    }

}
